#ifndef GAMESTATE_ENDGAME_ENDGAME_H
#define GAMESTATE_ENDGAME_ENDGAME_H


#include "SDL_ttf.h"
#include "Engine/Resource/Graphic.h"
#include "Engine/Sense.h"
#include "Engine/Visual.h"
#include "SDL.h"

namespace Engine { class Backbone; } 
namespace GameState { template<typename T> class DataStorage; } 

namespace GameState {

namespace Endgame {

class Endgame : public Engine::Sense, public Engine::Visual {
  private:
	Engine::Resource::Graphic endgameBg; 
	Endgame(); 

  public:
	~Endgame(); 
	inline virtual void exit(); 
	virtual Engine::Resource::GraphicList display(); // Asks for generation of a graphical model to be displayed
	void keyDown(SDLKey sym, SDLMod mod, Uint16 unicode); 
	static inline Endgame * raise(); // Raise the singleton object
	static void setScore(double score, double maxScore); 

  private:
	TTF_Font * font; 
	Uint16 gameTime; 
	Uint16 pieceCount; 
	static double score; 
	static double maxScore; 
	static Endgame * singleInstance; // Single instance of tutorial screen
	Engine::Resource::Graphic * scoreStatusGfx; 
	Engine::Resource::Graphic * pieceAverageGfx; 
	Engine::Resource::Graphic * totalPiecesGfx; 
};
inline void Endgame::exit() {
}

// Raise the singleton object
inline Endgame * Endgame::raise()
{
	if (singleInstance == NULL) singleInstance = new Endgame();
	return singleInstance;
}


} // namespace GameState::Endgame

} // namespace GameState
#endif
